<template>
	<view><!-- 登录部分 -->
		<view class="wellcome">
			<view class="hydl">1、验证身份</view>
			<view class="ysok">输入原始密码，点击确定</view>

			<view class="num">原密码</view>
			<view class="unum">
				<input type="password" v-model="oldpwd" value="" placeholder="请输入原密码" />
				<view class="psd"  v-show="tips">密码错误</view>
			</view>
			<button type="primary" @click="next">确认</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				oldpwd:'',
				useroldpwd:'',
				tips:false
			};
		},
		//接受到参数的页面旧密码页面
		onLoad(){
			let oldpwds = uni.getStorageSync("userpwd")
			this.useroldpwd= oldpwds
			console.log(this.useroldpwd)  
		},
		methods: {
			next(){
				if(this.oldpwd!==this.useroldpwd){
					// this.tips=true
					uni.showToast({
						icon:'error',
						title:"原密码错误"
					})
				} else {
					uni.setStorageSync("oldpwd",this.oldpwd)
					uni.navigateTo({
						url:"../updatapwd/updatapwd"
						
					})
				}
			}
		}
	}
</script>

<style lang="scss">
	* {
		// border: 1rpx solid;
	}


	/* 自定义导航栏 */
	

	.wellcome {
		padding: 70rpx;

		.hydl {
			font-size: 37rpx;
			font-weight: 600;
		}

		.ysok {
			font-size: 24rpx;
			margin-top: 20rpx;
			color: #999999;
		}

		.num {
			margin-top: 100rpx;
			font-size: 28rpx;
		}
		
		.unum{
			display: flex;
			justify-content: space-between;
			border-bottom: 1px solid #e8e8e8;
				margin-top: 14rpx;
			.psd{
				color: red;
				font-size: 20rpx;
				height: 32rpx;
				padding: 10rpx;
			}
		}

		input {
			font-size: 28rpx;
			color: #4CD964;
			padding: 10rpx 0;
		}

		button {
			margin-top: 60rpx;
		}

		.forgetpwd {
			margin-top: 20rpx;
			font-size: 30rpx;
			float: right;
			color: #999999;
		}
	}
</style>
